package student

import (
	"github.com/gin-gonic/gin"
	"project/pkg/dao/mysql"
	"project/pkg/router"
)

func init() {
	router.AddRouter(new(SRouter))
}

type SRouter struct {
}
type SHandler struct {
	M mysql.Mysql
}

func NewSHandler() *SHandler {
	return &SHandler{
		M: mysql.NewMysql(),
	}
}
func (SRouter) Router(e *gin.Engine) {
	handler := NewSHandler()
	student := e.Group("student")
	student.POST("/add/info", handler.UpdateInfo)
	student.GET("/delete", handler.StudentDelete)
	student.POST("/search/class", handler.SearchStudentByClass)
	student.POST("/search/one", handler.SearchStudentByStudentId)
	student.POST("/search/openid", handler.SearchStudentByOpenId)
	student.GET("/search/teacher/class", handler.SearchToClass)
	student.POST("/teacher/update", handler.UpdateInfoToTeacher)
}
